package drawarc;

import java.awt.*;
import javax.swing.*;

public class DrawArc extends JFrame {
    public DrawArc () {
        super("DrawArc");
        setVisible(true);
        setSize(600, 600);
    }
    public void drawArc(Graphics g, int x, int y, int width, int height, int startAngle, int arcAngle) {
        g.fillArc(x, y, width, height, startAngle, arcAngle);
    }
    public void paint(Graphics g) {
        super.paint(g);
        g.setColor(Color.black);
        Font now_font = g.getFont();
        g.setFont(new Font(now_font.getFontName(), now_font.getStyle(), 2 * now_font.getSize()));
        g.drawString("Welcome to Java world", 10, 450);
        g.setColor(Color.green);
        g.fillRect(295, 250, 10, 250);
        g.setColor(Color.blue);
        this.drawArc(g, 150, 100, 300, 300, 30, 30);
        this.drawArc(g, 150, 100, 300, 300, 120, 30);
        this.drawArc(g, 150, 100, 300, 300, 210, 30);
        this.drawArc(g, 150, 100, 300, 300, 300, 30);
    }
    public static void main (String[] args) {
        DrawArc app = new DrawArc();
        app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
